package gold.digger;

import gold.utils.InputUtil;

/**
 * Created by fanzhenyu02 on 2021/12/10.
 * common problem solver template.
 */
public class LC806 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int[] numberOfLines(int[] widths, String s) {
            int[] ans = new int[2];
            ans[0] = 1;
            for (char arr : s.toCharArray()) {
                ans[1] += widths[arr - 'a'];
                if (ans[1] > 100) {
                    ans[1] = widths[arr - 'a'];
                    ans[0]++;
                }
            }
            return ans;
        }
    }

    public void run() {
        int[] arr = InputUtil.toIntegerArray("[1,2,3]");
        System.out.println(new Solution().toString());
    }

    public static void main(String[] args) throws Exception {
        LC806 an = new LC806();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
